<?php
defined( '_VALID_MOS' ) or die('<script>window.location.href="http://www.kinifurniture.com";</script>');
$adm_functions->is_admin_login();
$adm_menu='
<table width="100%" class="menubar" cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td class="menudottedline" width="40%">
			<div class="pathway"><img src="assets/admin/'.$SITE_LOGO_ADMIN.'"/></div>	</td>
		<td class="menudottedline" align="right">
			<table cellpadding="0" cellspacing="0" border="0" id="toolbar">
				<tr valign="middle" align="center">
					<td>&nbsp;</td>
					<td>
					<a class="toolbar" href="javascript:kliksubmit();">
						<img src="show_files/save.png"  alt="Save" name="save" title="Save" align="middle" border="0" />				<br />Save</a>
					</td>
					<td>&nbsp;</td>
					<td>
						<a class="toolbar" href="admin.php?show=links_manager">
						<img src="show_files/cancel.png"  alt="Cancel" name="cancel" title="Cancel" align="middle" border="0" />				<br />Cancel</a>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<br />
';
if ($msg=='1')	$error_message='Success Edit Link Detail';

if ($id)
{
	$qryedit="select * from link where id=$id";
	$selectedit=$dbh->query($qryedit);

	while($sqlRowedit=mysql_fetch_object($selectedit))
	{
		$val_title=$sqlRowedit->nama_link; 
		$val_content=$sqlRowedit->abbreviation;
		$val_url=$sqlRowedit->alamat_link;
		if ($sqlRowedit->tampil=='1') 
		{
			$val_select1='selected';
			$val_select2='';
		}
			else 
		{
				$val_select1='';
				$val_select2='selected';
		}
		$val_newsid=$id;
		$section='Edit Link';
	}
}
if($inp_newsid)
{
	$dbh->query("update link set 
	nama_link='$inp_title', 
	abbreviation='$inp_content',
	alamat_link='$inp_url',
	tampil='$inp_active'
		where id=$inp_newsid");
	echo '<script>window.location.href="admin.php?show=edit_links&id='.$inp_newsid.'&msg=1";</script>';
}

?>